package com.heima.minio;


import com.heima.file.service.impl.MinIOFileStorageService;
import io.minio.MinioClient;
import io.minio.PutObjectArgs;
import io.minio.errors.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

@SpringBootTest()
public class test {


    public static void main(String[] args) {


        MinioClient build = MinioClient.builder().credentials("minio", "minio123").endpoint("http://192.168.200.130:9000").build();

        PutObjectArgs.builder().object("list.html");


    }
    

//    public static void main(String[] args) {
//
//
//        try {
//            FileInputStream fileInputStream = new FileInputStream("");
//            MinioClient minioClient = MinioClient.builder().credentials("minio,minio123", "http://192.168.200.130:9000").build();
//
//
//            PutObjectArgs putObjectArgs = PutObjectArgs.builder()
//                    .object("plungs/css/index.css")
//                    .contentType("text/html")
//                    .bucket("leadnews")
//                    .stream(fileInputStream,fileInputStream.available(),-1)
//                            .build();
//
//            minioClient.putObject(putObjectArgs);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//
//    }
}
